﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.Skins;
using DevExpress.LookAndFeel;
using DevExpress.UserSkins;
using DevExpress.XtraBars;
using DevExpress.XtraBars.Ribbon;
using DevExpress.XtraBars.Helpers;


namespace QLHOSO
{
    public partial class frmQLHSDT : RibbonForm
    {
        public frmQLHSDT()
        {
            InitializeComponent();
            InitSkinGallery();        

        }
        void InitData()
        {
            //tabMain.TabPages[0].Select();
           
        }
        void InitSkinGallery()
        {
            SkinHelper.InitSkinGallery(rgbiSkins, true);
        }
      
      //private void txtName_KeyDown(object sender, KeyEventArgs e)
      //  {
      //      if( e.KeyCode  == Keys.Enter ) 
      //           txtName1.Focus();
      //  }     

      private void QLHOSO_Load(object sender, EventArgs e)
      {
          // TODO: This line of code loads data into the 'ds_DanhMuc.tbl_TinhChat' table. You can move, or remove it, as needed.
          this.tbl_TinhChatTableAdapter.Fill(this.ds_DanhMuc.tbl_TinhChat);
          // TODO: This line of code loads data into the 'ds_DanhMuc.tbl_TrinhDo' table. You can move, or remove it, as needed.
          this.tbl_TrinhDoTableAdapter.Fill(this.ds_DanhMuc.tbl_TrinhDo);
          // TODO: This line of code loads data into the 'ds_DanhMuc.tbl_TonGiao' table. You can move, or remove it, as needed.
          this.tbl_TonGiaoTableAdapter.Fill(this.ds_DanhMuc.tbl_TonGiao);
          // TODO: This line of code loads data into the 'ds_DanhMuc.tbl_DanToc' table. You can move, or remove it, as needed.
          this.tbl_DanTocTableAdapter.Fill(this.ds_DanhMuc.tbl_DanToc);
          // TODO: This line of code loads data into the 'ds_DanhMuc.tbl_QuocTich' table. You can move, or remove it, as needed.
          this.tbl_QuocTichTableAdapter.Fill(this.ds_DanhMuc.tbl_QuocTich);
          tabMain.SelectedTabPageIndex = 0;          
      }  
        
     

      private void navQuoctich_ItemChanged(object sender, EventArgs e)
      {
          if (navQuoctich.Expanded)
          {
              navDantoc.Expanded = false;
              navTongiao.Expanded = false;
              navQuoctich.Expanded = true;
          }
          else
          {
              navDantoc.Expanded = false;
              navTongiao.Expanded = false;
          }
      }

      private void navDantoc_ItemChanged(object sender, EventArgs e)
      {
          if (navDantoc.Expanded)
          {
              navQuoctich.Expanded = false;
              navTongiao.Expanded = false;
              navDantoc.Expanded = true;
          }else
          {
              navQuoctich.Expanded = false;
              navTongiao.Expanded = false;
          }
         
      }

      private void navTongiao_ItemChanged(object sender, EventArgs e)
      {
          if (navTongiao.Expanded)
          {
              navQuoctich.Expanded = false;
              navDantoc.Expanded = false;
              navTongiao.Expanded = true;
          }
          else
          {
              navQuoctich.Expanded = false;
              navDantoc.Expanded = false;
          }          
      }          
    

      private void iExit_ItemClick(object sender, ItemClickEventArgs e)
      {
          //this.tbl_QuocTichTableAdapter.GetData();
          //this.tbl_QuocTichTableAdapter.Fill(this.ds_QuocTich.tbl_QuocTich);
          //this.Validate();
      }

      private void navTrinhDo_ItemChanged(object sender, EventArgs e)
      {

      }

      private void navDoiTuong_ItemChanged(object sender, EventArgs e)
      {

      }

      private void btXoaQT_Click(object sender, EventArgs e)
      {
          if (MessageBox.Show("Bạn có muốn xóa quốc tịch này không ?", "Cảnh báo", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
          {
             btXoaQT.Checked = true;
          }
          else
          {
              btXoaQT.Checked = false;
          }
      }

      private void btLuuQT_Click(object sender, EventArgs e)
      {
          if (MessageBox.Show("Bạn có muốn lưu danh sách này không ?", "Cảnh báo", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
          {             
              this.tbl_QuocTichTableAdapter.Update(this.ds_DanhMuc.tbl_QuocTich);
          }
      }

      private void btXoaDT_Click(object sender, EventArgs e)
      {
          if (MessageBox.Show("Bạn có muốn xóa dân tộc này không ?", "Cảnh báo", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
          {
              btXoaDT.Checked = true;
          }
          else
          {
              btXoaDT.Checked = false;
          }
      }

      private void btLuuDT_Click(object sender, EventArgs e)
      {
          if (MessageBox.Show("Bạn có muốn lưu danh sách này không ?", "Cảnh báo", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
          {
              this.tbl_DanTocTableAdapter.Update(this.ds_DanhMuc.tbl_DanToc);
          }

      }

      private void btXoaTG_Click(object sender, EventArgs e)
      {
          if (MessageBox.Show("Bạn có muốn xóa tôn giáo này không ?", "Cảnh báo", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
          {
              btXoaTG.Checked = true;
          }
          else
          {
              btXoaTG.Checked = false;
          }
      }

      private void btLuuTG_Click(object sender, EventArgs e)
      {
          if (MessageBox.Show("Bạn có muốn lưu danh sách này không ?", "Cảnh báo", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
          {
              this.tbl_TonGiaoTableAdapter.Update(this.ds_DanhMuc.tbl_TonGiao);
          }
      }

      private void btXoaTD_Click(object sender, EventArgs e)
      {
          if (MessageBox.Show("Bạn có muốn xóa trình độ học vấn này không ?", "Cảnh báo", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
          {
              btXoaTD.Checked = true;
          }
          else
          {
              btXoaTD.Checked = false;
          }
      }

      private void btLuuTD_Click(object sender, EventArgs e)
      {
          if (MessageBox.Show("Bạn có muốn lưu danh sách này không ?", "Cảnh báo", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
          {
              this.tbl_TrinhDoTableAdapter.Update(this.ds_DanhMuc.tbl_TrinhDo);
          }
      }

      private void btXoaTC_Click(object sender, EventArgs e)
      {
          if (MessageBox.Show("Bạn có muốn xóa tính chất đối tượng này không ?", "Cảnh báo", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
          {
              btXoaTC.Checked = true;
          }
          else
          {
              btXoaTC.Checked = false;
          }
      }

      private void btLuuTC_Click(object sender, EventArgs e)
      {
          if (MessageBox.Show("Bạn có muốn lưu danh sách này không ?", "Cảnh báo", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
          {
              this.tbl_TinhChatTableAdapter.Update(this.ds_DanhMuc.tbl_TinhChat);
          }
      }

   

      private void button1_Click(object sender, EventArgs e)
      {
          MessageBox.Show("Click here!");
      }

      private void tabPage2_DoubleClick(object sender, EventArgs e)
      {
          SendKeys.Send("{ENTER}");         
      }

     
     
    }
}